import 'package:flutter/cupertino.dart';

import '../../../../../lib_baseview/lib_baseview.dart';
import '../../../../../resource/language/generated/l10n.dart';

/// 播放全部组件
class PlayAllWidget extends StatelessWidget {
  final int count;
  final VoidCallback? onTap;

  const PlayAllWidget({super.key, required this.count, this.onTap});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: Container(
        height: 44,
        alignment: Alignment.center,
        padding: const EdgeInsets.symmetric(horizontal: 24),
        child: Row(
          mainAxisSize: MainAxisSize.max,
          children: [
            image('ic_play.svg', width: 22, height: 22),
            const SizedBox(width: 10),
            Text(T.current!.play_all,
                style: TextStyle(color: Color(0xFF666666), fontSize: 13)),
            const Spacer(),
            Text(T.current!.total_few_song(count),
                style: const TextStyle(color: Color(0xFF999999), fontSize: 13)),
          ],
        ),
      ),
    );
  }
}
